package com.example.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.mapper.OrderMapper;
import com.example.model.Order;
import com.example.service.OrderService;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.Date;

/**
 * @author lbq
 * @version 1.0
 * @date 2021/5/16 12:53
 */
@Service
public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements OrderService {

    @Override
    public void add(Integer num) {
        ArrayList<Order> orders = new ArrayList<>();
        for (int i = 1; i <= num; i++) {
            Order order = new Order();
            order.setDel(0);
            order.setUserId(i * 100 + i);
            order.setCompanyId(i * 1000 + i);
            order.setPublishUserId(i * 10000 + i);
            order.setPositionId(i * 100000 + i);
            order.setResumeType(0);
            order.setStatus("WAIT");
            order.setCreateTime(new Date());
            order.setUpdateTime(new Date());
            orders.add(order);
        }
        saveBatch(orders);
    }
}
